package org.origin.centre.model.enums.result;

import org.origin.centre.support.base.interfaces.XResult;
import org.springframework.http.HttpStatus;

/**
 * 数据返回枚举
 *
 * @author ferret
 * @version 2024-05-08
 */
public enum RS implements XResult {
    OK(HttpStatus.OK.value(), "请求成功"),
    FAIL(HttpStatus.BAD_REQUEST.value(), "请求失败"),

    Sr(HttpStatus.OK.value(), "查询成功"),
    Fr(HttpStatus.BAD_REQUEST.value(), "查询失败"),

    Si(HttpStatus.OK.value(), "添加成功"),
    Fi(HttpStatus.BAD_REQUEST.value(), "添加失败"),

    Su(HttpStatus.OK.value(), "修改成功"),
    Fu(HttpStatus.BAD_REQUEST.value(), "修改失败"),

    Sd(HttpStatus.OK.value(), "删除成功"),
    Fd(HttpStatus.BAD_REQUEST.value(), "删除失败"),

    Sn(HttpStatus.OK.value(), "启用成功"),
    Fn(HttpStatus.BAD_REQUEST.value(), "启用失败"),

    So(HttpStatus.OK.value(), "禁用成功"),
    // 失败返回
    Fo(HttpStatus.BAD_REQUEST.value(), "禁用失败");

    private final Integer status;
    private final String message;

    RS(Integer status, String message) {
        this.status = status;
        this.message = message;
    }

    @Override
    public Integer getStatus() {
        return status;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
